//
//  AISetLogOutView.m
//  Mia
//
//  Created by Vill on 2024/1/15.
//

#import "AISetLogOutView.h"

@interface AISetLogOutView ()

@property (nonatomic, strong) UIButton *logOutBtn;
@end

@implementation AISetLogOutView

- (instancetype)initWithFrame:(CGRect)frame{
    if (self == [super initWithFrame:frame]){
        [self addSubview:self.logOutBtn];
        [self.logOutBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.mas_equalTo(self).mas_offset(PTW(20));
            make.trailing.mas_equalTo(self).mas_offset(-PTW(20));
            make.centerY.mas_equalTo(self);
            make.height.mas_equalTo(PTW(55));
        }];
    }
    return self;
}

-(void)logOutAction:(UIButton *)btn{
    if(self.logOutBlock){
        self.logOutBlock();
    }
}

// 下一步
- (UIButton *)logOutBtn{
    if(!_logOutBtn){
        _logOutBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _logOutBtn.layer.cornerRadius = PTW(55)/2;
        _logOutBtn.layer.masksToBounds = YES;
        [_logOutBtn setTitle:@"Lou out" forState:UIControlStateNormal];
        [_logOutBtn setTitleColor:[UIColor colorHex:@"#5C5C5C"] forState:UIControlStateNormal];
        _logOutBtn.backgroundColor = [UIColor colorHex:@"#FFFFFF" alpha:0.5];
        _logOutBtn.titleLabel.font = [UIFont fontWithWeight:MTBold size:PTW(15)];
        [_logOutBtn addTarget:self action:@selector(logOutAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _logOutBtn;
}

@end
